﻿@inject HttpClient Http
@inject NavigationManager NavigationManager
@inject IStringLocalizerFactory LocalizerFactory
@using Microsoft.Extensions.Localization

<div class="p-4 mb-4 mx-4 bg-white border border-gray-200 rounded-lg shadow-sm dark:border-gray-700 sm:p-6 dark:bg-gray-800">
    <h3 class="mb-2 text-lg font-medium text-gray-900 dark:text-white">@Localizer["Title"]</h3>

    <div class="mb-3 text-sm text-gray-600 dark:text-gray-400">@Localizer["Description"]</div>

    <Button OnClick="ChangePassword">@Localizer["ChangePasswordButton"]</Button>
</div>

@code {
    private IStringLocalizer Localizer => LocalizerFactory.Create("Components.Main.Settings.Security.PasswordChangeSection", "AliasVault.Client");

    /// <summary>
    /// Gets or sets a value indicating whether Two-Factor Authentication is enabled.
    /// </summary>
    [Parameter]
    public bool TwoFactorEnabled { get; set; }

    /// <summary>
    /// Event callback that is invoked when the Two-Factor Authentication status changes.
    /// </summary>
    [Parameter]
    public EventCallback OnStatusChanged { get; set; }

    private bool IsLoading { get; set; } = true;

    /// <summary>
    /// Navigates to the change password page.
    /// </summary>
    private void ChangePassword()
    {
        NavigationManager.NavigateTo("settings/security/change-password");
    }
}
